package cn.jg.web.controller.sys.response;

import cn.jg.framework.common.bean.Converter;
import cn.jg.model.sys.Company;
import lombok.Data;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * Created by admin on 2023/06/06.
 */
@Data
public class CompanyFoundResponse implements Converter<Company, CompanyFoundResponse> {

    /**
     * id
     */
    private Integer id;

    /**
     * 0,个人1,企业2,机构
     */
    private Integer type;

    /**
     * 名称
     */
    private String name;

    /**
     * 详情
     */
    private String details;

    @Override
    public CompanyFoundResponse convert(Company company) {
        CompanyFoundResponse response = CompanyMapper.INSTANCE.convert(company);
        return response;
    }

    @Mapper
    interface CompanyMapper {
        CompanyMapper INSTANCE = Mappers.getMapper(CompanyMapper.class);

        CompanyFoundResponse convert(Company company);
    }
}